Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise PyROS second-stage equality reformulation under discrete (scenario-based) uncertainty #3533

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

shermanjasonaf
Copy link
Contributor

@shermanjasonaf shermanjasonaf commented Mar 22, 2025

Summary/Motivation:

This PR modifies the PyROS solver preprocessor's treatment of second-stage equality constraints that are state-variable independent, for cases wherein the user-supplied uncertainty set is discrete (or scenario-based). Every such constraint is now treated as follows:

  • The decision rule expressions are substituted for the second-stage variables
  • For each of the (finitely many, hard-coded) scenarios in the uncertainty set, a duplicate of the constraint subject to the scenario is appended to the first-stage equality constraints
  • The constraint is removed from the model

That is, when the uncertainty set is discrete, these equality constraints are no longer reformulated by casting to two inequalities (which increases the number of separation problems) or polynomial coefficient matching (which may be restrictive).

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@shermanjasonaf
Copy link
Contributor Author

@jas-yao @natalieisenberg

@blnicho blnicho requested review from jsiirola and blnicho March 25, 2025 19:11
Copy link
Member

@blnicho blnicho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found one typo but otherwise this looks fine.

Copy link

codecov bot commented Apr 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.71%. Comparing base (8f07dc9) to head (89ffe76).
Report is 32 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3533      +/-   ##
==========================================
- Coverage   88.71%   88.71%   -0.01%     
==========================================
  Files         888      888              
  Lines      102024   102041      +17     
==========================================
+ Hits        90513    90527      +14     
- Misses      11511    11514       +3     
Flag Coverage Δ
builders 26.56% <6.66%> (+<0.01%) ⬆️
default 84.82% <100.00%> (?)
expensive 33.95% <6.66%> (?)
linux 86.22% <100.00%> (-2.24%) ⬇️
linux_other 86.22% <100.00%> (+0.04%) ⬆️
osx 76.15% <100.00%> (+0.06%) ⬆️
win 84.71% <100.00%> (+0.04%) ⬆️
win_other 84.71% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants